<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="mall/advert/include::header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>邮费模板添加</h5>
					</div>
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
							<input type="hidden" name="id" id="id" th:value="${dispatch.id}">
							<div class="form-group">
								<label class="col-sm-3 control-label">邮费模板名称:</label>
								<div class="col-sm-8">
									<input id="dispatchname" name="dispatchname" class="form-control" type="text" th:value="${dispatch.dispatchname}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">排序:</label>
								<div class="col-sm-8">
									<input id="displayorder" name="displayorder" class="form-control" type="number" min="0" th:value="${dispatch.displayorder}">
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-3 control-label">计费方式:</label>
								<div class="col-sm-8">
									<label class="radio-inline"> <input type="radio" name="calculatetype" value="0" th:field="*{dispatch.calculatetype}"/> 按重量计费</label>
									<label class="radio-inline"> <input type="radio" name="calculatetype" value="1" th:field="*{dispatch.calculatetype}"/> 按件计费</label>
								</div>
							</div>
							<div class="form-group" id="typeWeightTable">
								<label class="col-sm-3 control-label"></label>
								<div class="col-sm-7">
									<table class="table">
										<thead>
											<tr>
												<th>首重(克)</th>
												<th>首费(元)</th>
												<th>续重(克)</th>
												<th>续费(元)</th>
											</tr>
										</thead>
										<tbody>
											<tr>
												<td><input class="form-control" type="number" min="0" name="firstweight" value="1000" th:value="${dispatch.firstweight}"></td>
												<td><input class="form-control" type="number" min="0" name="firstprice" value="" th:value="${dispatch.firstprice}"></td>
												<td><input class="form-control" type="number" min="0" name="secondweight" value="1000" th:value="${dispatch.secondweight}"></td>
												<td><input class="form-control" type="number" min="0" name="secondprice" value="" th:value="${dispatch.secondprice}"></td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>

							<div class="form-group" id="typeNumTable">
								<label class="col-sm-3 control-label"></label>
								<div class="col-sm-7">
									<table class="table">
										<tbody>
										<tr>
											<th style="width: 15%">1件邮费</th>
											<td><input class="form-control" type="number" min="0" name="pricenum1" th:value="${dispatch.pricenum1}"></td>
										</tr>
										<tr>
											<th>2件邮费</th>
											<td><input class="form-control" type="number" min="0" name="pricenum2" th:value="${dispatch.pricenum2}"></td>
										</tr>
										<tr>
											<th>3件邮费</th>
											<td><input class="form-control" type="number" min="0" name="pricenum3" th:value="${dispatch.pricenum3}"></td>
										</tr>
										<tr>
											<th>4件邮费</th>
											<td><input class="form-control" type="number" min="0" name="pricenum4" th:value="${dispatch.pricenum4}"></td>
										</tr>
										<tr>
											<th>5件邮费</th>
											<td><input class="form-control" type="number" min="0" name="pricenum5" th:value="${dispatch.pricenum5}"></td>
										</tr>
										<tr>
											<th>6件邮费</th>
											<td><input class="form-control" type="number" min="0" name="pricenum6" th:value="${dispatch.pricenum6}"></td>
										</tr>
										<tr>
											<th>7件邮费</th>
											<td><input class="form-control" type="number" min="0" name="pricenum7" th:value="${dispatch.pricenum7}"></td>
										</tr>
										<tr>
											<th>8件邮费</th>
											<td><input class="form-control" type="number" min="0" name="pricenum8" th:value="${dispatch.pricenum8}"></td>
										</tr>
										<tr>
											<th>9件邮费</th>
											<td><input class="form-control" type="number" min="0" name="pricenum9" th:value="${dispatch.pricenum9}"></td>
										</tr>
										<tr>
											<th>10件邮费</th>
											<td><input class="form-control" type="number" min="0" name="pricenum10" th:value="${dispatch.pricenum10}"></td>
										</tr>
										</tbody>
									</table>
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-3 control-label">是否启用:</label>
								<div class="switch onoffswitch col-sm-1">
									<div class="onoffswitch">
										<input type="checkbox"  class="onoffswitch-checkbox" value="1" checked="" id="status" name="status" th:checked="${dispatch.status} == 1">
										<label class="onoffswitch-label" for="status">
											<span class="onoffswitch-inner"></span>
											<span class="onoffswitch-switch"></span>
										</label>
									</div>
								</div>
							</div>

							<div class="form-group text-center">
								<div class="col-sm-8 col-sm-offset-2">
									<button type="submit" class="btn btn-primary"><i class="fa fa-check"></i>提交</button>
									<div class="btn btn-danger" onclick="closeDow()"><i class="fa fa-remove"></i> 关闭</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div th:include="mall/advert/include::footer"></div>
	<script type="text/javascript" src="/js/appjs/mall/dispatch/edit.js">
	</script>
	<script type="text/javascript">
		function closeDow() {
			var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
			parent.layer.close(index);
		}
	</script>
</body>

</html>
